perl -0pe 's/(.*)\n(.*)\n/$1 $2\n/g' file.txt